<template>
  <div class="goods-count">
    <BBEchart :options="options"></BBEchart>
  </div>
</template>

<script lang='ts'>
import { computed, defineComponent } from "vue";
import BBEchart from "@/base-ui/echart/index";
export default defineComponent({
  components: {
    BBEchart,
  },
  props: {
    data: {
      type: Array,
    },
  },
  setup(props) {
    const options = computed(() => {
      return {
        tooltip: {
          trigger: "item",
        },
        legend: {
          orient: "horizontal",
          left: "left",
        },
        series: [
          {
            name: "Access From",
            type: "pie",
            radius: "50%",
            data: props.data,
            emphasis: {
              itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: "rgba(0, 0, 0, 0.5)",
              },
            },
          },
        ],
      };
    });

    return {
      options,
    };
  },
});
</script>

<style>
</style>